<template>
    <div class="searchGoods">
        <div>
            <p>搜索结果</p>
            <hr>
        </div>
        <goods :list="list"></goods>
        <load-more @load="loadMore">
            <template v-if="ifMore"><img src="../images/loading.gif" alt="加载中" width="150"></template>
            <template v-else>没有更多</template>
        </load-more>
    </div>

</template>
<script>
require('./goodsList.css');
var goods=require('./lib/goods.vue');
var loadMore=require('./lib/loadMore.vue');
var listCore=require('./lib/list/list-core');
var urlParm=require('./lib/urlParm');
module.exports={
    components:{
        loadMore:loadMore,
        goods:goods,
    },
    mixins:[listCore],
    data:function () {
        return{
            whichList:'goodsArray',
            params:{
                keyword:'asd',
            },
            request: function (params, status) {
                var item = $.extend({}, params, status);
                return JxSdk.goods.search(item.keyword,null,null,item.page);
            },
        }
    },
    methods:{
        loadMore:function () {//滚动刷新
            this.loadNextPage();
        },
    },
    created:function () {
        var url=urlParm.default();
        this.params.keyword=decodeURI(url.keyword);
    },
    beforeRouteUpdate: function(to, from, next) {
        next();
        var url=urlParm.default();
        this.params.keyword=decodeURI(url.keyword);
    },
}
</script>